package com.nine.pattern.proxy.static_proxy;

/**
 * @author nine
 * @version 1.0
 * @description TODO
 * @date 2024-07-04 22:20
 */
public class ProxyPoint2 implements SellTicket {

	// 使用聚合，耦合度更小
	private SellTicket sellTicket;

	public ProxyPoint2() {
	}

	// 通过构造函数传递 SellTicket 接口的实现
	public ProxyPoint2(SellTicket sellTicket) {
		this.sellTicket = sellTicket;
	}

	// 或者可以通过setter方法设置 SellTicket
	public void setSellTicket(SellTicket sellTicket) {
		this.sellTicket = sellTicket;
	}

	@Override
	public void sell() {
		System.out.println("代理卖票");
		sellTicket.sell();
	}
}
